package com.example.demo.mapper;

import com.example.demo.domain.test;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface testMapper {
    @Select("select * from test")
    List<test> listall();

    @Select("select * from test where id = #{id}")
    test selectByid(int id);

    @Select("select * from test where name like concat('%',#{name},'%')")
    List<test> selectBylike(String name);

    @Delete("delete from test where id = #{id}")
    int delectByid(int id);

    @Insert("insert into test (id,name,password) " + " values " + "(#{id} , #{name} , #{password}) ")
    void add(test t1);

    @Update("update test set id = #{id} , name = #{name} , password = #{password} where id = #{id}")
    int amendByid(test t2);
}
